package com.config;

import com.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class Config {
    @Primary
    @Bean(name = "admin")
    public User returnUser(){
        User user = new User();
        user.setName("admin");
        user.setAge(18);
        return user;
    }

    @Bean("zhangsan")
    public User returnUser1(){
        User user = new User();
        user.setName("zhangsan");
        user.setAge(78);
        return user;
    }

    @Bean(name = {"lisi","wangwu"})
    public User returnUser2(){
        User user = new User();
        user.setName("lishi,wangwu");
        user.setAge(48);
        return user;
    }

}
